<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript" src="${ctx}/page/member/js/alterLoginPassword.js"></script>
<div class="panel panel-default">
	<div class="panel-heading">登录密码修改</div>
	<div class="panel-body">
		<form>
			<div class="form-group">
				<label for="oldPassword">原密码</label> 
				<input type="text" class="form-control" id="oldPassword" />
			</div>
			<div class="form-group">
				<label for="newPassword">新密码</label> 
				<input type="text" class="form-control" id="newPassword"/>
			</div>
			<div class="form-group">
				<label for="reNewPassword">确认新密码</label> <input type="text"
					class="form-control" id="reNewPassword"/>
			</div>
			<div class="form-group">
				<label for="emailCode">验证码</label>
				<div class="input-group">
					<input id="emailCode" type="text" class="form-control"> 
					<span class="input-group-btn">
						<button onclick="sendEmailCode()" class="btn btn-default" type="button">发送邮箱验证码</button>
					</span>
				</div>
			</div>
			<button type="button" onclick="save()" class="btn btn-default">保存设置</button>
			<span id="error_message"></span>
		</form>
	</div>
</div>

	<script type="text/javascript">
		function sendEmailCode(){
			$.ajax({
				type : 'POST',
				url : ctx + '/sendEmailCode.do',
				data : {
				},
				dataType : 'json',
				timeout : 30000,
				context : $('body'),
				success : function(data) {
					if (data.code == "ok") {
						showTip2('验证码已经发送到您的邮箱，请注意查收!');
					} else {
						showTip2(data.msg);
					}
				},
				error : function(xhr, type) {
					showTip2('提交失败!');
				}
			});
		}
	</script>